home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / inter54e.zip / INTSUM16.ZIP / ERR_EXIT.CPP < prev    next >
C/C++ Source or Header  |  1996-10-13  |  1KB  |  44 lines

  1. //*********************************************************
  2. //  ERR_EXIT.CPP - Semi-standard error handler             
  3. //                                                         
  4. //  Copyright (c) 1996 Daniel D. Miller                               
  5. //                                                         
  6. //  Last Update:  08-20-95 02:18pm                         
  7. //                                                         
  8. //*********************************************************
  9.  
  10. #include <stdio.h>
  11. #include <stdlib.h>  //  exit()
  12. #include "err_exit.hpp"
  13. // #include <memcheck.h>
  14.  
  15. /*****************  ERROR CODES AND CONSTANTS  *******************/
  16. char *errmsg[] = {
  17. "Usage: INTERIM ",
  18. "Out of memory",
  19. "Unable to open INTERRUP.A for reading\n"
  20. "You may need to set LIST_DIR in INTSUM.INI",
  21. "Unable to open file for reading",
  22. "Unable to open file for writing",
  23. "Invalid data format",
  24. "USAGE message is too long",
  25. "\nForward search failed ",
  26. "\nUnable to open configuration file",
  27. "\nUnable to open debugging output file",
  28. "\nReverse search failed ",
  29. "This program requires MSDOS 3.0 or later",
  30. NULL } ;
  31.  
  32. //*******************************************************************
  33. void error_exit(int err_code, char* errstr)
  34.    {
  35.    puts("") ;
  36.    if (errstr == NULL)
  37.       puts(errmsg[err_code]) ;
  38.    else
  39.       printf("%s: %s\n", errstr, errmsg[err_code]) ;
  40.    exit(err_code) ;
  41.    }
  42.  
  43.  
  44.